﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Windvoice.Authorize
{
    public class ManagerValidateAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            //if (filterContext.HttpContext.Request != null && !String.IsNullOrEmpty(filterContext.HttpContext.Request.Form["session"]))
            //{
            //}

            if (filterContext.HttpContext.Session["user"] == null || !new string[] { "104312", "14D1144C03B9D540AD6728B48B56B983" }.Contains(((User)filterContext.HttpContext.Session["user"]).UniqueID))
            {
                filterContext.Result = new RedirectResult("/manage/login");
            }

            base.OnActionExecuting(filterContext);
        }
    }
}
